﻿using System.Windows.Controls;

using Game.Command;

namespace SL
{
    public class ScheduleCommandButton : Button
    {
        readonly SchedulerCommand _SchedulerCommand;

        public ScheduleCommandButton(SchedulerCommand schedulerCommand)
        {
            _SchedulerCommand = schedulerCommand;

            schedulerCommand.PropertyChanged += (sender, args) => EnableButtons();
            EnableButtons();
        }

        void EnableButtons()
        {
            IsEnabled = _SchedulerCommand.IsEnabled;
        }
    }
}
